package com.etc.test1;

import java.util.List;

import com.xju.entity.Movie;
import com.xju.tools.DBTools;
import com.xju.tools.PageData;

/**
 * 
 * @author admin
 *
 */
public class TestQueryByPage {

	public static void main(String[] args) {

		String sql = "select * from tbl_movie where mname like ? ";
		//Object exQuery(String sql, Class cls, Object... params)
		int page = 2 ;
		int pageSize = 10;
		PageData<Movie> pd = (PageData<Movie>) DBTools.exQueryByPage
				(sql, Movie.class, page, pageSize, "%%");
		
		System.out.println("getTotalCount(): "+ pd.getTotalCount());
		System.out.println("getTotalPage() : "+pd.getTotalPage());
		for (Movie movie : pd.getData()) {
			System.out.println(movie);
		}
		
	}

}
